home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / CONTRSRC.ZIP / SRC / WAVES / ARMWAVES.TXT / text0000.txt < prev   
Encoding:
Text File  |  1994-09-30  |  2.3 KB  |  79 lines

  1. Hi guys,
  2.  
  3. I promised this text several moons ago but I've been a little busy so
  4. I couldn't bring it to you. I've read some of you are in the good way to
  5. get it, hope this helps.
  6.  
  7.  
  8. It's an excerpt from the sources of this part.
  9. The sources of this part and probably the Rubber Polygons will be
  10. released as soon as I get them, probably next week.
  11. (If someone is so nice to tell me the procedure do upload something at
  12. ftp.eng.ufl.edu I'll be eternally grateful as I've never done it before).
  13.  
  14. Well, here it goes.
  15.  
  16. ===8<=====================================================
  17. ; // UpdateTable : performs one integration step on U[CT]  //  ARM 12/93
  18.  
  19. ; Differential equation is:  u  = a▓( u  + u  )
  20. ;                             tt       xx   yy
  21. ;
  22. ; Where a▓ = tension * gravity / surface_density.
  23. ;
  24. ; Aproximating second derivatives by central differences:
  25. ;
  26. ;  [ u(t+1)-2u(t)+u(t-1) ] / ït▓ = a▓ (u(x+1)+u(x-1)+u(y+1)+u(y-1)-4u) / h▓
  27. ;
  28. ; (where ït = time step, h=ïx=ïy = mesh resolution
  29. ;
  30. ; From where u(t+1) may be calculated as:
  31. ;                   ⌡   1   └
  32. ; u(t+1) = a▓ït▓/h▓ ■ 1 0 1 ■u - u(t-1) + (2-4a▓ït▓/h▓)u
  33. ;                   ┴   1   π
  34. ;
  35. ; When a▓ït▓/h▓ = ╜ last term vanishes, giving:
  36. ;                   ⌡   1   └
  37. ;        u(t+1) = ╜ ■ 1 0 1 ■u - u(t-1)
  38. ;                   ┴   1   π
  39. ;
  40. ; This needs only 4 ADD/SUB and one SAR operation per mesh point!
  41. ;
  42. ; (note that u(t-1,x,y) is only used to calculate u(t+1,x,y) so
  43. ;  we can use the same array for both t-1 and t+1, needing only
  44. ;  two arrays, U[0] and U[1])
  45. ;
  46. ; Dampening is simulated by subtracting 1/2^n of result.
  47. ; n=4 gives best-looking result
  48. ; n<4 (eg 2 or 3) thicker consistency, waves die out immediately
  49.  
  50. ; n>4 (eg 8 or 12) more fluid, waves die out slowly
  51.  
  52. ;
  53. ===8<=====================================================
  54.  
  55. Po' si son torpes ;-), explica que
  56.  
  57.          ⌡   1   └
  58.          ■ 1 0 1 ■u  1*u(x-1,y)+0*u(x,y)+1*u(x+1,y)
  59.          ┴   1   π
  60.                      +1*u(x,y+1)+1*u(x,y-1)
  61.  
  62. osa, que queda:
  63.  
  64. u[1,x,y] = (u[0,x-1,y]+u[0,x+1,y]+u[0,x,y-1]+u[0,x,y+1])/2 - u[1,x,y]
  65.  
  66. intercambiando los papeles de u[0] y u[1] despues de cada paso, claro.
  67.  
  68. >----------------------------------------------------------------------
  69.  
  70.  
  71. --
  72. Saludos Cesar.
  73.  
  74. mtl93023@oasis.dit.upm.es/*iGUANA
  75. 2:341/27.37@fidonet.eur Pacific Point. Nada de Nada.
  76.  
  77.  
  78.  
  79.